package Servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import Info.RoomInfo;
import Manage.RoomManage;


public class UpdateRoomS extends HttpServlet{
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		response.setContentType("text/html;charset=utf-8");
		request.setCharacterEncoding("utf-8");
		
		int rid=Integer.parseInt(request.getParameter("rid"));
		String roomId=request.getParameter("roomId");
		String roomArea=request.getParameter("roomArea");
		String bedNum=request.getParameter("bedNum");
		String roomPrice=request.getParameter("roomPrice");
		String roomType=request.getParameter("roomType");
		String roomLevel=request.getParameter("roomLevel");
		String toilet=request.getParameter("toilet");
		String airConditioner=request.getParameter("airConditioner");
		String TV=request.getParameter("TV");
		String telephone=request.getParameter("telephone");
		String roomStatus=request.getParameter("roomStatus");
		String comments=request.getParameter("comments");
		
		
		RoomManage roomm=new RoomManage();
		RoomInfo room=new RoomInfo(rid,roomId,roomArea,bedNum,roomPrice,roomType,roomLevel,toilet,airConditioner,TV,telephone,roomStatus,comments);
			roomm.updateRoom(room);
			request.getRequestDispatcher("LookRoomServlet").forward(request, response);
	  }
}
